package com.ljx.recruitment.interview.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * @Author: LiJunXi
 * @Description:
 * @Date: 2024-11-02  10:24
 */
@Getter
@AllArgsConstructor
public enum JobCategoryEnum {

    CAMPUS(1, "校园招聘"),
    SOCIAL(2, "社会招聘");

    private Integer key;
    private String desc;
    private static Map<Integer, JobCategoryEnum> cache;

    static {
        cache = Arrays.stream(JobCategoryEnum.values()).collect(Collectors.toMap(JobCategoryEnum::getKey, Function.identity()));
    }

    public static JobCategoryEnum getByKey(Integer key){
        return cache.get(key);
    }
}
